﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ensynch.FIM;

namespace TestFimTools
{
    class Program
    {
        // Create a logger for use in this class.
        private static readonly log4net.ILog log =
            log4net.LogManager.GetLogger(
            System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

        static Program()
        {
            FimTools.LogMessageGenerated += 
                new EventHandler<Ensynch.Events.LogEventArgs>(
                    FimTools_LogMessageGenerated);
        }

        static void FimTools_LogMessageGenerated(object sender, 
            Ensynch.Events.LogEventArgs e)
        {
            log.Logger.Log(typeof(Program), e.LogLevel, e.Msg, null);
        }

        static void Main(string[] args)
        {
            // First call should invoke web service call.
            bool isMultiValued = FimTools.IsMultiValued("MailNickname");
            // Second call should reuse the value.
            isMultiValued = FimTools.IsMultiValued("MailNickname");

            log.Debug("MailNickname is multi-valued? " + isMultiValued);

            Console.Write("Press enter to exit...");
            Console.ReadLine();
        }
    }
}
